package com.plantplaces.dao;

import java.util.ArrayList;
import java.util.List;

import com.plantplaces.dto.Plant;
import com.plantplaces.dto.PlantSearch;

public class PlantDAOStub implements IPlantDAO {

	@Override
	public List<Plant> fetchPlants(PlantSearch plantSearch) throws Exception {
		// Create an ArrayList that will hold all of my trees.
		List<Plant> allPlants = new ArrayList<Plant>();

		// if (plantSearch.getGenus() == "Cercis") {
		if (plantSearch.getGenus().equals("Cercis")) {
			// make a plant object.
			Plant redbud = new Plant();
			redbud.setGenus("Cercis");
			redbud.setSpecies("canadensis");
			redbud.setCultivar("");
			redbud.setCommon("Redbud");
			redbud.setId(83);
			allPlants.add(redbud);

			// make a plant object.
			Plant fpRedbud = new Plant();
			fpRedbud.setGenus("Cercis");
			fpRedbud.setSpecies("canadensis");
			fpRedbud.setCultivar("Forest Pansy");
			fpRedbud.setCommon("Redbud");
			fpRedbud.setId(119);
			allPlants.add(fpRedbud);
		
		}

		if (plantSearch.getGenus().equalsIgnoreCase("Malus")) {
			Plant fuji = new Plant();
			fuji.setGenus("Malus");
			fuji.setSpecies("domestica");
			fuji.setCultivar("Fuji");
			fuji.setCommon("Fuji Apple");
			fuji.setId(2);
			allPlants.add(fuji);
		}

		// TODO Auto-generated method stub
		return allPlants;
	}

	@Override
	public Plant fetchPlantByPlantPlacesId(int id) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

}
